/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: SubmissionReportServiceImpl
 * Author:   周宏硕
 * Date:     2018/10/30 10:33
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.htwx.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.htwx.dao.SubmissionReportDao;
import com.htwx.entity.SubmissionReport;
import com.htwx.service.SubmissionReportService;

/**
 * @author 周宏硕
 * @create 2018/10/30
 * @since 1.0.0
 */
@Service("SubmissionReportService")
@Transactional
public class SubmissionReportServiceImpl implements SubmissionReportService {

    @Autowired
    private SubmissionReportDao submissionReportDao;

    @Override
    public List<SubmissionReport> findSubmissionReportByWxId(String wxId) {
        return submissionReportDao.findSubmissionReportByWxId(wxId);
    }

    @Override
    public String  insertSubmissionReport(SubmissionReport submissionReport) {
        int i = submissionReportDao.insertSubmissionReport(submissionReport);
        String flag = "";
        if(i>0) {
            flag = "ok";
        }else {
            flag="no";
        }
        return flag;

    }

    @Override
    public String updateSubmissionReport(SubmissionReport submissionReport) {
        Integer result = submissionReportDao.updateSubmissionReport(submissionReport);
        if(result!=-1){
            return "ok";
        }else if (result==0){
            return "null";
        }else {
            return  "error";
        }


    }

    @Override
    public Integer deleteSubmissionReport(Integer report_id) {
        return submissionReportDao.deleteSubmissionReport(report_id);
    }

    @Override
    public Integer updateEvaluate(SubmissionReport submissionReport) {

        return submissionReportDao.updateEvaluate(submissionReport);
    }

    @Override
    public Integer findEvaluateCountById(String wxId) {
        return submissionReportDao.findEvaluateCountById(wxId);
    }


    @Override
    public List<SubmissionReport> findNotEvaluateById(String wxId) {
        return submissionReportDao.findNotEvaluateById(wxId);
    }

    @Override
	public List<SubmissionReport> findSubmissionReportAll(Integer status) {
		// TODO Auto-generated method stub
		return submissionReportDao.findSubmissionReportAll(status);
	}


}
